<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>

<body>
  <script type="text/javascript" src="travel.common.js"></script>
  <script type="text/javascript">
    // var data = "{ID:6965,Name:'wduan',Type:'0',CardNo:'MFW170511141641424',Mobile:'15023653307',Point:59755,Count:0,Remark:'',Courtesy:'',Company:'','Region':'0','Notes':'MFW接口创建会员',Contact:[{id:4217,name:'吴瑖',tel:'15023653307'}],Passenger:[[585672,'代付款','成人','护照','a1321540','15632032102','1991/3/12 0:00:00','',0,1,0,0,0,'','',0,'','','','',''],[585671,'大幅度发','成人','护照','a123154','15630221023','1991/3/21 0:00:00','',0,1,0,0,0,'','',0,'','','','',''],[585670,'发送到的','成人','护照','a1234654','15632103210','1991/3/21 0:00:00','',0,1,0,0,0,'','',0,'','','','',''],[585267,'吴小莉','儿童','身份证','20120520','15023655543','','',0,1,0,0,0,'','',0,'','','','','长度错'],[584717,'谭金花','成人','身份证','500233199106277743','18716338290','1991/6/27 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',262,'研发','0','女','',''],[585669,'达到啊','成人','护照','a1321540','15682132450','1991/3/12 0:00:00','',0,1,0,0,0,'','',0,'','','','',''],[585668,'打发第三','成人','护照','a123450','15632102321','1991/3/12 0:00:00','',0,1,0,0,0,'','',0,'','','','',''],[585667,'梁媛搜索','成人','护照','a13246540','15683662321','1975/2/13 0:00:00','',0,1,0,0,0,'','',0,'','','','',''],[584830,'何琼','成人','身份证','500238199402103563','13667603930','1994/2/10 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',264,'行政','10','女','',''],[585152,'吴霞','成人','身份证','500242199201042885','15023653307','1992/1/4 0:00:00','',0,2,2,0,84,'010135.00008078','星合联盟差旅测试',265,'客服','10,11','女','',''],[584507,'丁香','成人','身份证','500101199308191626','18716574134','1993/8/19 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',263,'运营','11','女','',''],[585663,'完善','成人','身份证','120103199401018758','15047654432','1994/1/1 0:00:00','',0,1,0,0,0,'','',0,'','','男','',''],[585664,'测试','成人','身份证','120103199401012030','15476570738','1994/1/1 0:00:00','',0,1,0,0,0,'','',0,'','','男','',''],[584825,'何平','成人','身份证','500234199110053693','15826419347','1991/10/5 0:00:00','',0,2,2,0,84,'010135.00008078','星合联盟差旅测试',261,'运维','3','男','',''],[585662,'新人真假','成人','身份证','140203199201012916','15643456432','1992/1/1 0:00:00','',0,1,0,0,0,'','',0,'','','男','',''],[584834,'冉雪梅','成人','身份证','500242199509042080','15898685985','1995/9/4 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',265,'客服','11','女','',''],[585391,'林海','成人','身份证','460033197105280016','12345678987','1971/5/28 0:00:00','',0,1,0,0,0,'','',0,'','','男','',''],[584837,'尹丹丹','成人','身份证','500234199105083222','15023653308','1991/5/8 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',266,'财务','1,10','女','',''],[585337,'武文绮','成人','身份证','411024199409120040','13673813540','1994/9/12 0:00:00','',0,2,2,0,84,'010135.00008078','星合联盟差旅测试',261,'运维','3,11','女','',''],[572453,'梁媛','成人','身份证','500230199310010289','15123656545','','',0,1,4,0,84,'010135.00008078','星合联盟差旅测试',261,'运维','3,11,8','','',''],[585644,'吴玢','成人','身份证','653101196712142414','15754325567','1967/12/14 0:00:00','',0,1,0,0,0,'','',0,'','','男','',''],[585586,'吴昊','儿童','身份证','20140520','15023653307','','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',265,'客服','','','','校验错长度错'],[584835,'张小艳','成人','身份证','511622199403177023','15689858965','1994/3/17 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',265,'客服','11','女','',''],[585592,'罗雯靖','成人','身份证','511302198511020027','13890881310','1985/11/2 0:00:00','',0,2,2,0,93,'010135.00008085','工行南充工行南充分行测试分行测试',1699,'四川分行个人金融业务部','3','女','',''],[565616,'黄艳平','成人','身份证','500237199110108948','13628360122','1991/10/10 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',263,'运营','1,11','女','',''],[585449,'谢一弦','成人','身份证','450204198301030614','15878198800','1983/1/3 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',260,'星合联盟差旅测试','','男','',''],[585451,'覃栎夫','成人','身份证','452701198708222714','13471197424','1987/8/22 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',260,'星合联盟差旅测试','11','男','',''],[585332,'黄河','成人','身份证','520103198509266710','18885066099','1985/9/26 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',260,'星合联盟差旅测试','','男','',''],[585331,'李泉','成人','身份证','520102196908012413','13984125333','1969/8/1 0:00:00','',0,1,2,0,84,'010135.00008078','星合联盟差旅测试',260,'星合联盟差旅测试','','男','',''],[585265,'穆太力普阿卜杜热西提','成人','身份证','653224199003051775','15292951288','1990/3/5 0:00:00','',0,1,0,0,0,'','',0,'','','男','',''],[584856,'艾艳青','成人','身份证','411322198708301035','15023653307','1987/8/30 0:00:00','',0,4,2,0,84,'010135.00008078','星合联盟差旅测试',267,'工行测试','','男','',''],[585266,'王迪','成人','身份证','230203198203221030','13304524299','1982/3/22 0:00:00','',0,1,0,0,0,'','',0,'','','男','','']],Addr:[{id:1071,addr:'重庆重庆市江北区建北一村23-5-2(吴瑖收)15023653307',address:'建北一村23-5-2'}],Perm:[[5513,0,0,8]],Plan:[[584507,'2017/8/15 0:00:00','2017/8/17 0:00:00','海口','重庆,广州,北京','','培训','2'],[585152,'2017/8/19 0:00:00','2017/8/23 0:00:00','北京','重庆,上海,广州','','培训','2'],[585337,'2017/8/16 0:00:00','2017/8/25 0:00:00','天津','厦门,广州,成都','','会议','2'],[585337,'2017/8/23 0:00:00','2017/8/25 0:00:00','上海','广州','','会议','2']]}";


    var data = "{ID: 6965,  Name: 'wduan', Type: '0', CardNo: 'MFW170511141641424',Mobile: '15023653307', Point: 59755, Count: 0,Remark: '', Courtesy: '',Company: '','Region': '0','Notes': 'MFW接口创建会员',Contact: [{id: 4217, name: '吴瑖', tel: '15023653307'}],Passenger: [[585672, '代付款', '成人', '护照', 'a1321540', '15632032102', '1991/3/12 0:00:00', '', 0, 1, 0, 0, 0, '', '', 0, '', '', '', '', '']],Addr: [{id: 1071, addr: '重庆重庆市江北区建北一村23-5-2(吴瑖收)15023653307', address: '建北一村23-5-2'}],Perm: [[5513, 0, 0, 8]],Plan: [[584507, '2017/8/15 0:00:00', '2017/8/17 0:00:00', '海口', '重庆,广州,北京', '', '培训', '2'], [585152, '2017/8/19 0:00:00', '2017/8/230:00:00', '北京', '重庆,上海,广州', '', '培训', '2'], [585337, '2017/8/16 0:00:00', '2017/8/25 0:00:00', '天津', '厦门,广州,成都', '', '会议', '2'],[585337, '2017/8/23 0:00:00', '2017/8/25 0:00:00', '上海', '广州', '', '会议', '2']]}";



    console.log(eval('(' + data + ')'));


    let passengerIdArr = ['585674'];//吴霞
    // let passengerIdArr = ['585152'];//吴霞
    //  let passengerIdArr = ['585337'];//武文绮
    //  let passengerIdArr = ['585337', '584825'];//武文绮 // 何平
    //let passengerIdArr = ['584834'];//冉雪梅
    //let passengerIdArr = ['584825', '584830'];//何平//何琼
    //let passengerIdArr = ['585391', '585256'];//林海//谭金花
    //  let passengerIdArr = ['', '584825'];//新增乘机人//何平
    //  let passengerIdArr = ['584825', ''];//何平//新增乘机人
    //let passengerIdArr = ['585391', '584825'];//林海//何平
    //let passengerIdArr = ['585391'];//林海
    //let passengerIdArr = ['585391', '584507'];//林海//丁香
    //let passengerIdArr = ['584825', '565616'];//何平 //黄艳平
    //let passengerIdArr = ['584825'];//何平
    //let passengerIdArr = ['572453', '584825'];//梁媛//何平
    //let passengerIdArr = ['584825','572453'];//何平//梁媛
    //let passengerIdArr = ['584825', '585256'];//何平 //谭金花
    //let passengerIdArr = ['584834', '584825'];//冉雪梅 // 何平
    //let passengerIdArr = ['585337', '584507'];//武文绮 // 丁香
    //  let passengerIdArr = ['585337', '584507', '585256'];//武文绮 // 丁香 //谭金花
    //let passengerIdArr = ['585337', '584507', '572453'];//武文绮 // 丁香 //梁媛
    //let passengerIdArr = ['585337', '572453']; //武文绮  //梁媛
    //let passengerIdArr = ['585337', '572453', '585256'];//武文绮  //梁媛 //谭金花
    //let passengerIdArr = ['572453', '585256'];//梁媛 //谭金花
    //let passengerIdArr = ['585391', '585256'];//林海 //谭金花

    //  "PassengerID":"585337","StartDate":"2017/7/15 8:00:00","EndDate":"2017/7/17 8:00:00","From":"北京","To":"重庆","Type":"","Reason":"培训","Status":"2"}

    // from 起始地
    // to 到达地
    // goDate 起始时间
    // backDate 到达时间
    // roundTrip（1单程、2往返去程、3往返回程）
    // tickitType（票的类型：0飞机票、1火车票、2汽车票、3船票、4滴滴打车）

    // danChengDate goDate
    // fanChengDate backDate
    let strokeInfo = { from: '北京', to: '重庆', goDate: '2017-08-05', backDate: '', roundTrip: 1, tickitType: 0 };

    let strokeInfo1 = { from: '北京', to: '重庆', goDate: '2017-08-10', backDate: '2017-08-15', roundTrip: 3, tickitType: 0 };//roundTrip//1单程 //2往返去程 //3往返回程
    let strokeInfo2 = { from: '广州', to: '北京', goDate: '2017-08-15', backDate: '', roundTrip: 3, tickitType: 0 };//roundTrip//1单程 //2往返去程 //单独回程


    let rs = CheckTravelPolicyFun(data, passengerIdArr, strokeInfo);
    console.log('单程                 ', rs);

    // let rs1 = CheckTravelPolicyFun(data, passengerIdArr, strokeInfo1);
    // console.log('往返                 ', rs1);

    // let rs2 = CheckTravelPolicyFun(data, passengerIdArr, strokeInfo2);
    // console.log('单独返程             ', rs2);
  </script>
</body>

</html>